package com.ijustyce.denoise.fragment;

import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import butterknife.BindView;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.ijustyce.denoise.R;
import com.kunminx.linkage.LinkageRecyclerView;
//import com.kunminx.linkage.bean.DefaultGroupedItem;
//import com.xuexiang.xaop.annotation.SingleClick;
import com.xuexiang.xui.utils.SnackbarUtils;
import com.xuexiang.xui.widget.actionbar.TitleBar;
import com.xuexiang.xui.widget.actionbar.TitleUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * A simple {@link Fragment} subclass.
 * create an instance of this fragment.
 */
public class DetailFragment extends Fragment {

    @BindView(R.id.linkage)
    LinkageRecyclerView linkage;

    View mRootView;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

//        System.out.println(DemoDataProvider.getGroupItems());
    }



//    @Nullable
//    @Override
//    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
//        mRootView = inflateView(inflater, container);
////        linkage=new LinkageRecyclerView(this.getContext());
//        initViews();
//        return mRootView;
//    }
//    protected View inflateView(LayoutInflater inflater, ViewGroup container) {
//        return inflater.inflate(getLayoutId(), container, false);
//    }
//    protected int getLayoutId() {
//        return R.layout.fragment_detail;
//    }
//
//    protected void initViews() {
//
////        System.out.println("nihao"+demoDataProvider.getGroupItems());
//        linkage.init(DemoDataProvider.getGroupItems());
//
//        linkage.setScrollSmoothly(true);
//        linkage.setDefaultOnItemBindListener(
//                (primaryHolder, primaryClickView, title) -> {
//                    //一级列表点击
//                    SnackbarUtils.Short(primaryClickView, title).show();
//                },
//                (primaryHolder, title) -> {
//                    //一级列表样式设置
//                    //TODO
//
//                },
//                (secondaryHolder, item) -> {
//                    //二级列表点击
//                    secondaryHolder.getView(R.id.level_2_item).setOnClickListener(v -> SnackbarUtils.Short(v, item.info.getTitle()).show());
//                },
//                (headerHolder, item) -> {
//                    //TODO
//                },
//                (footerHolder, item) -> {
//                    //TODO
//                }
//        );
//    }

}